%% To import in the preambule
%\usepackage{listings}

% "define" Tool grammar
\lstdefinelanguage{toolgrammar}{
  alsoletter={;,:,\{,\},\,},
  morekeywords={catch, class, def, else, extends, false, finally, for, if, new, null, object, return, this, throw, throws, try, true, val, var, while,
  return,;,:,\{,\},\,},
  sensitive=true,
  morecomment=[s]{Identi}{fier},
  morecomment=[s]{State}{ment},
  morecomment=[s]{Method}{Declaration},
  morecomment=[s]{Var}{Declaration},
  morecomment=[s]{Try}{Clause},
  morecomment=[s]{Throw}{Clause},
  morecomment=[s]{Throws}{Clause},
  morecomment=[s]{Catch}{Clause},
  morecomment=[s]{Finally}{Clause},
  morecomment=[s]{Tool}{Exception},
  morecomment=[s]{Expres}{sion},
  morecomment=[s]{Ty}{pe},
}

\newcommand{\grammarstyle}{\small\sffamily}

% Default settings for grammar listings
\lstset{
  escapeinside=!!,
  frame=tb,
  language=toolgrammar,
%  aboveskip=3mm,
%  belowskip=3mm,
%  lineskip=-0.1em,
  showstringspaces=false,
  columns=fullflexible,
  mathescape=true,
  numbers=none,
  numberstyle=\tiny,
  basicstyle=\grammarstyle
} 
